package com.skrabacz.kinetic.buisness.logic;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;

public class RestultTreeSetShould {

	private RestultSet rs;

	@Before
	public void setUpBeforeSingleTest() {
		rs = new ResultTreeSet();
	}

	@Test(expected = NullPointerException.class)
	public void throwNullPointerWhenAddingNullPoint() throws Exception {
		assertFalse(rs.addPoint(null));
	}

	@Test
	public void returnTrueWhenAddingUniquePoint() throws Exception {
		assertTrue(rs.addPoint(new Node()));
	}

	@Test
	public void returnFalseWhenAddingNonUniquePoint() throws Exception {
		Point point = new Node();
		assertTrue(rs.addPoint(point));
		assertFalse(rs.addPoint(point));
	}
}
